﻿using Basic.FlowCollect;
using Basic.FlowLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowLocalEvent.Flow
{
    [LocalEventName("Delete")]
    internal class ClearNodeMsg : IEventHandler<FlowEvent>
    {
        private readonly INodeMsgCollect _NodeMsg;

        public ClearNodeMsg ( INodeMsgCollect nodeEvent )
        {
            this._NodeMsg = nodeEvent;
        }

        public void HandleEvent ( FlowEvent data, string eventName )
        {
            this._NodeMsg.Clear(data.Flow.Id);
        }
    }
}
